package com.qf.dto;

import com.qf.entity.CheckNull;
import com.qf.entity.CheckType;
import org.springframework.util.ObjectUtils;

/*
杨威
2021/10/26
20:31
*/
public class UserDto implements CheckNull {
    private String usercode;
    private String password;

    public UserDto() {
    }

    public UserDto(String usercode, String password) {
        this.usercode = usercode;
        this.password = password;
    }

    public String getUsercode() {
        return usercode;
    }

    public void setUsercode(String userCode) {
        this.usercode = userCode;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "UserDto{" +
                "usercode='" + usercode + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
    @Override
    public boolean isNull(CheckType checkType) {
        System.out.println("userCode = " + usercode);
        System.out.println("password = " + password);
        return ObjectUtils.isEmpty(usercode)||ObjectUtils.isEmpty(password)||password.length()<3||usercode.length()<4;
    }
}
